package com.timous.web;

import com.timous.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class ArchiveShowController {

    @Autowired
    private BlogService blogService;

    @GetMapping("/archives")
    public String archives(Model model){

        model.addAttribute("archiveMap" , blogService.achiveBlog());

        model.addAttribute("blogcount" , blogService.countBlog());


        return "blogarchives";
    }



}
